using System;
using System.Data;

namespace xiushen.Domain
{
    [Serializable]
    public class QueryParameter
    {

        #region Fields

        private string _name;

        #endregion


        #region Properties

        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }
        }

        public string ParameterName
        {
            get
            {
                return _name.Replace(".", "").Replace("[", "").Replace("]", "");
            }
        }

        public object Value { get; set; }

        public SqlDbType? Type { get; set; }

        #endregion


        #region Public Methods

        public QueryParameter(string name, object value, SqlDbType type)
        {
            _name = name;
            Value = value;
            Type = type;
        }

        public QueryParameter(string name, object value)
        {
            _name = name;
            Value = value;
        }

        #endregion

    }
}